package com.atguigu.gmall.product.client;

import com.atguigu.gmall.model.product.*;
import com.atguigu.gmall.product.client.impl.ProductFeignClientImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Author: lx
 * @Time: 11:38
 * @Description:
 */
@FeignClient(name = "service-product",fallback = ProductFeignClientImpl.class)
public interface ProductFeignClient {

    //2：查询一二三级分类
    @GetMapping("/api/product/inner/getBaseCategoryView/{category3Id}")
    public BaseCategoryView getBaseCategoryView(@PathVariable Long category3Id);
    //1：查询SkuInfo对象
    @GetMapping("/api/product/inner/getSkuInfo/{skuId}")
    public SkuInfo getSkuInfo(@PathVariable Long skuId);
    //3：查询价格
    @GetMapping("/api/product/inner/getPrice/{skuId}")
    public BigDecimal getPrice(@PathVariable Long skuId);

    //4:查询当前商品spu对应的所有的销售属性及属性值集合 并 skuid进行选中
    @GetMapping("/api/product/inner/getSpuSaleAttrAndChecked/{spuId}/{skuId}")
    public List<SpuSaleAttr> getSpuSaleAttrAndChecked(@PathVariable Long spuId,
                                                      @PathVariable Long skuId);
    //5: 销售属性值ID的组合 对应 skuId 数据
    @GetMapping("/api/product/inner/getSaleAttrValuesBySpu/{spuId}")
    public Map getSaleAttrValuesBySpu(@PathVariable Long spuId);
    //查询所有分类视图对象集合
    @GetMapping("/api/product/inner/getBaseCategoryViewList")
    List<BaseCategoryView> getBaseCategoryViewList();

    //根据ID查询品牌
    @GetMapping("/api/product/inner/baseTrademark/{id}")
    public BaseTrademark getBaseTrademark(@PathVariable Long id);

    //查询平台属性及属性值 根据skuId
    @GetMapping("/api/product/inner/getBaseAttrInfoAndBaseAttrValue/{skuId}")
    public List<SkuAttrValue> getBaseAttrInfoAndBaseAttrValue(@PathVariable Long skuId);
}
